<template>
<!-- 248, 248, 248 -->
  <div class="content-box">
    <!-- <van-nav-bar
      style="background-color: #f8f8f8;"
      title="社保卡领卡/激活网点查询"
    /> -->
    <div class="main-box">
      <div class="bank-box">
        银行类型: {{bankCategory}}
      </div>
      <div class="pointer">
        <div class="title">
          银行网点
        </div>
        <div class="bank-pointer" v-for="(item, index) in searchResult" :key="index">
          <span style="margin-left: 10px;">{{item.outletName}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'searchCard',
  data () {
    return {
      bankCategory: this.$route.query.bankCategory,
      value: '',
      searchResult: [{
        aae008b: '955880106001', // 银行类型
        outletName: '红棉支行' // 网点名称
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }, {
        aae008b: '955880106001',
        outletName: '红棉支行'
      }]
    }
  },
  methods: {
    // 获取查询结果
    getSearchDetail () {
      this.$http.post('getBankOutletList', this.$route.query.searchForm, { 'Content-Type': 'application/json' }
      ).then(res => {
        console.log(res.data)
        this.searchResult = res.data.length > 0 ? res.data : { outletName: '暂无网点' }
      })
        .catch(() => {
          this.$toast.fail('网络错误，查询失败')
        })
    }
  },
  created () {
    console.log(this.$route.query)
    this.getSearchDetail()
  }
}
</script>

<style lang="less" scoped>
.content-box{
  min-height: 100vh;
  background-color: #f8f8f8;
  .main-box{
    margin: 0 10px 10px 10px;
    padding-top: 10px;
    font-size: 14px;
    .bank-box{
      margin-bottom: 10px;
    }
    .pointer{
      .title{
        margin-bottom: 10px;
      }
      .bank-pointer{
        height: 30px;
        border: 1px solid #cfcfcf;
        border-bottom: none;
        span{
          line-height: 30px;
        }
      }
      & > :nth-last-child(1){
        border: 1px solid #cfcfcf;
      }
    }
  }
}
</style>
